package com.apps.realtyportal;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jason.apps.dashboard.AddAmmenities;
import com.jason.apps.dashboard.AddPanoramaImage;
import com.jason.apps.dashboard.AddProperty;
import com.jason.apps.dashboard.EditProperty;

public class MyFragmentPagerAdapterManageProperty extends FragmentPagerAdapter {

	final int PAGE_COUNT = 4;

	/** Constructor of the class */
	public MyFragmentPagerAdapterManageProperty(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}

	/** This method will be invoked when a page is requested to create */
	@Override
	public Fragment getItem(int arg0) {
		Bundle data = new Bundle();
		switch (arg0) {

		/** Android tab is selected */
		case 0:
			AddProperty addPropertyFragment = new AddProperty();
			data.putInt("current_page", arg0 + 1);
			addPropertyFragment.setArguments(data);
			return addPropertyFragment;

			/** Apple tab is selected */
		case 1:
			AddAmmenities addAmmenities = new AddAmmenities();
			data.putInt("current_page", arg0 + 1);
			addAmmenities.setArguments(data);
			return addAmmenities;

			/** Apple tab is selected */
		case 2:
			AddPanoramaImage addPanoramaFragment = new AddPanoramaImage();
			data.putInt("current_page", arg0 + 1);
			addPanoramaFragment.setArguments(data);
			return addPanoramaFragment;

			/** Apple tab is selected */
		case 3:
			EditProperty editPropertyFragment = new EditProperty();
			data.putInt("current_page", arg0 + 1);
			editPropertyFragment.setArguments(data);
			return editPropertyFragment;

		}

		return null;
	}

	/** Returns the number of pages */
	@Override
	public int getCount() {
		return PAGE_COUNT;
	}

}
